
<div class="toolbox divider">
	<select id="selectUser" class="button" onchange="findScheduler(this.options[this.selectedIndex].value)">
		<option value="${Session.user.id}">${Session.user.realname}</option>
	</select>
</div>

<script type="text/javascript">
	var mainPanel = 'mainPanel';
	
	var init = function(){
		var request = new Request.JSON({
			url: "/data/sc.action",
			onComplete: function(json,text) {
				if (json.recorders) {
					json.recorders.each(function (item, index) {
						$(selectUser).grab(new Element('option',{'value':item.id,'html':item.realname}));
					});
				}
			}//onComplete
		}).get({"scid":"dc_users"});//Request.JSON
	}
	
	var findScheduler = function(userid){
		//alert(userid);
		MUI.updateContent({
			'loadMethod':'iframe',
			'element':  $(mainPanel),
			'url':      '/dayscheduler/scheduler.action?userid='+userid
		});
	}
	
window.addEvent('domready', function() {
	init();

});	
</script>
	